<?php
namespace app\index\validate;

use app\index\model\User;
use think\Validate;

class Jie extends Validate
{
    protected $rule = [
    	'captcha'=>'require|captcha',
        'cid'=>'require',
        'title'=>'require|min:10',
        'content'=>'require|min:10',
        'kiss'=>'require|checkKiss'
    ];

    public function checkKiss($kiss,$rule,$data)
    {
    	$user = User::get(session('uid'));

    	if($user->kiss>$kiss){
    		return true;
    	}else{
    		return "飞吻不足,请先充值";
    	}
    }
}